home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Symbiosis_UltimateGameboy.lha / SYMBIOSIS-UGBS / Install next >
Text File  |  2002-08-18  |  4KB  |  194 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #prefix @app-name)            ;name of slave, directory
  6. (set #demo_exe "UltimateGameBoy.adf")    ;name of demo exe
  7. (set #demo_rename "Disk.1")        ;new demo name
  8. (set #site "Aminet")        ;name of site hosting the file
  9. (set #demo_url "http://www.aminet.net/demo/funet/UltGameboy.lha")    ;name of archive file
  10. (set #pt_replay "proreplay.bin")    ;name of protracker replay routine
  11.  
  12. ;****************************
  13. ;----------------------------
  14. ; checks if given program is installed, if not abort install
  15. ; #program - to check
  16.  
  17. (procedure P_ChkRun
  18.   (if (= 0 (run ("cd SYS:\nWhich %s >NIL:" #program)))
  19.     ("")
  20.     (abort
  21.       (cat
  22.     "You must install \"" #program "\" first!\n"
  23.     "It must be accessible via the path.\n"
  24.     "You can find it in the WHDLoad package."
  25.       )
  26.     )
  27.   )
  28. )
  29.  
  30. ;----------------------------
  31. ; Wait for inserting disk
  32. ; IN:  #AD_disk - name of disk
  33. ; OUT: -
  34.  
  35. (procedure P_disk
  36.   (message (cat
  37.              "\n"
  38.              "You MUST first download the demo\n"
  39.              "from \"" #site "\" and extract it to RAM:\n"
  40.              "\n"
  41.              "\"" #demo_url "\""
  42.              "\n\n"
  43.              "Ensure the file \"" #demo_exe "\" is available in RAM:"))
  44. )
  45.  
  46. ;----------------------------
  47.  
  48. ;****************************
  49.  
  50. (if (< @installer-version (+ (* 44 65536) 10))
  51.   (
  52.     (message
  53.       (cat
  54.         "Warning: your installer is outdated.\n"
  55.         "Some features of this installation won't be available, "
  56.         "such as icon show and drawer opening. "
  57.         "You have version " (/ @installer-version 65536) "." 
  58.         (BITAND @installer-version 65535) ", recommended is version 44.10. "
  59.         "The 'installer' 44.10 comes with OS 3.5 but is also contained in the NDK 3.9. "
  60.         "You may also use the InstallerNG by Jens Tröger."
  61.         "\n\n"
  62.         "The installers can be obtained from the net:\n"
  63.         "http://www.amiga.com/3.9/download/NDK3.9.lha\n"
  64.         "aminet:util/sys/InstallerNG.lha"
  65.       )
  66.     )
  67.     (set #newstuff 0)
  68.   )
  69.   (set #newstuff 1)
  70. )
  71.  
  72. (if (exists #readme-file)
  73.   (if (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  74.     ("")
  75.     (run ("SYS:Utilities/More %s" #readme-file))
  76.   )
  77. )
  78.  
  79. (set #program "WHDLoad")
  80. (P_ChkRun)
  81.  
  82. (if (getenv "WHDLInstPath")
  83.   (set @default-dest (getenv "WHDLInstPath"))
  84. )
  85. (set #dest
  86.   (askdir
  87.     (prompt
  88.       (cat
  89.     "Where should \"" @app-name "\" be installed?\n"
  90.     "A drawer \"" #prefix "\" will be automatically created."
  91.       )
  92.     )
  93.     (help @askdir-help)
  94.     (default @default-dest)
  95.   )
  96. )
  97. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
  98. (set #dest (tackon #dest #prefix))
  99. (if (exists #dest) (
  100.   (set #choice
  101.     (askbool
  102.       (prompt
  103.         (cat
  104.           "\nDirectory \"" #dest "\" already exists.\n"
  105.           "Should it be deleted?"
  106.         )
  107.       )
  108.       (default 1)
  109.       (choices "Delete" "Skip")
  110.       (help @askbool-help)
  111.     )
  112.   )
  113.   (if (= #choice 1)
  114.     (delete #dest
  115.       (help @delete-help)
  116.       (all)
  117.     )
  118.   )
  119. ))
  120. (makedir #dest
  121.   (help @makedir-help)
  122.   (infos)
  123. )
  124.  
  125. ;----------------------------
  126. (copyfiles
  127.   (help @copyfiles-help)
  128.   (source ("%s.Slave" @app-name))
  129.   (dest #dest)
  130. )
  131. (if
  132.   (exists ("%s.newicon" @app-name))
  133.   (set #icon
  134.     (askchoice
  135.       (prompt "\nWhich icon would you like to install?\n")
  136.       (default 0)
  137.       (choices "ColorIcon" "NewIcon")
  138.       (help @askchoice-help)
  139.     )
  140.   )
  141.   (set #icon 0)
  142. )
  143. (select #icon
  144.   (set #icon ("%s.coloricon" @app-name))
  145.   (set #icon ("%s.newicon" @app-name))
  146. )
  147. (copyfiles
  148.   (help @copyfiles-help)
  149.   (source #icon)
  150.   (newname ("%s.info" @app-name))
  151.   (dest #dest)
  152. )
  153. (if
  154.   (exists #readme-file)
  155.   (copyfiles
  156.     (help @copyfiles-help)
  157.     (source #readme-file)
  158.     (dest #dest)
  159.   )
  160. )
  161. (if
  162.   (exists ("%s.info" #readme-file))
  163.   (
  164.     (copyfiles
  165.       (help @copyfiles-help)
  166.       (source ("%s.info" #readme-file))
  167.       (dest #dest)
  168.     )
  169.     (tooltype
  170.       (dest (tackon #dest #readme-file))
  171.       (noposition)
  172.     )
  173.   )
  174. )
  175.  
  176. ;----------------------------
  177.  
  178. (P_disk)
  179. (copyfiles
  180.   (help @copyfiles-help)
  181.   (source ("RAM:%s" #demo_exe))
  182.   (newname ("%s" #demo_rename))
  183.   (dest #dest)
  184. )
  185. (copyfiles
  186.   (help @copyfiles-help)
  187.   (source ("%s" #pt_replay))
  188.   (dest #dest)
  189. )
  190. ;----------------------------
  191.  
  192. (run ("Delete \"RAM:%s\" ALL QUIET FORCE" #demo_exe))
  193. (exit)
  194.